package com.longbig.dto;

public enum NodeTypeEnum {

    MAIN_PROCESS("custom-main", "process"),
    STEP("custom-step", "parallelGateway"),
    SERVICE_TASK("custom-circle", "serviceTask"),
    EDGE("edge", "sequenceFlow");

    private String x6ShapeName;

    private String flowableNodeType;

    NodeTypeEnum(String x6ShapeName, String flowableNodeType) {
        this.x6ShapeName = x6ShapeName;
        this.flowableNodeType = flowableNodeType;
    }

    //通过x6ShapeName获取flowableNodeType
    public static String getFlowableNodeType(String x6ShapeName) {
        for (NodeTypeEnum nodeTypeEnum : NodeTypeEnum.values()) {
            if (nodeTypeEnum.x6ShapeName.equals(x6ShapeName)) {
                return nodeTypeEnum.flowableNodeType;
            }
        }
        return null;
    }

    //通过x6ShapeName获取NodeTypeEnum的值
    public static NodeTypeEnum getNodeTypeEnum(String x6ShapeName) {
        for (NodeTypeEnum nodeTypeEnum : NodeTypeEnum.values()) {
            if (nodeTypeEnum.x6ShapeName.equals(x6ShapeName)) {
                return nodeTypeEnum;
            }
        }
        return null;
    }
}
